module.exports = app => {
    const mongoose = app.mongoose;
    const Schema = mongoose.Schema;
  
    const ForwardSchema = new Schema({
      ownerWxid: { type: String, required: true, index: true }, // 所属微信号
      wxid: { type: String, required: true }, 
      nick: {type: String, default: ''}, // 微信昵称
      fromwxid: { type: String, required: true },
      fromnick: { type: String, default: '' }, // 来源昵称
      status: { type: Boolean, default: true }, // 开关
    });
  
    // 索引建议（提高查询效率）
    ForwardSchema.index({ ownerWxid: 1 });
    ForwardSchema.index({ wxid: 1 });
    ForwardSchema.index({ fromwxid: 1 });
    ForwardSchema.index({ status: 1 });
  
    return mongoose.model('Forward', ForwardSchema, 'forward');
  };
  